home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1997 September & October
/
Amiga-CD 1997 #9-10.iso
/
software
/
fm2_demo
/
rexx
/
showprojects.rexx
next >
Wrap
OS/2 REXX Batch file
|
1996-10-29
|
2KB
|
87 lines
/******************************************************************/
/* ClassX Amiga Rexx script - Copyright © 1996 ClassX Development */
/******************************************************************/
/*
$VER: ShowProjects.rexx 1.0
$INF: loads and shows all the projects in the "FontMachine:projects" dir.
*/
MYPORT = 'FontMachine'
IF ~SHOW('P', MYPORT) THEN DO
IF EXISTS('FontMachine:FontMachine') THEN DO
ADDRESS COMMAND 'Run >NIL: FontMachine:FontMachine'
DO 30 WHILE ~SHOW('P',MYPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "FontMachine could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', MYPORT) THEN DO
SAY 'FontMachine Rexx port could not be opened.'
EXIT 10
END
ADDRESS VALUE MYPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
/******************************************************************/
/* Make sure rexxsupport library is opened */
IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30)
LockGui
/* set relevant paths for projects and temp files */
PrjDir = 'FontMachine:Project/'
/* scan the projects dir */
Files = SHOWDIR(PrjDir,'f',"|")
fLength = LENGTH(Files)
nList=0
DO WHILE fLength>0
cLength=pos('|',Files)
IF cLength=0 THEN DO
cLength=FLength+1
fLength=0
END
cFile = LEFT(Files,cLength-1)
pFile = PrjDir||cFile
/* load the project */
FreeFont
FreeTexture Front
FreeTexture Border
LoadProject pFile
IF RC=0 THEN DO
/* wait the rendering of the font */
DO WHILE FM_RESULT ~= 0
CheckRedraw
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
Request '"Message"' '"Project: '||cFile||'"' 'Ok|Stop'
END
ELSE Request '"ARexx Error"' '"'FM_ERROR'"' 'Ok'
/* check if user has stopped the script */
IF FM_RESULT=0 THEN FLength = 0
/* next project */
if FLength~=0 then Files=right(Files,fLength-cLength)
fLength=fLength-cLength
end
Request '"ARexx Message"' '"End"' 'Ok'
UnLockGui
/******************************************************************/